<?php
 /**
 * 功能描述：	邮箱工具类
 * @datetime	2024-01-30
 * @version   	v1.0
 * @author   	ZHL
 * @copyrigh  	2020 ZHL 版权所有
 */

class C_EmailController extends Controller {

    function index(){
        exit('error');
    }

    /**
     * Notes:测试
     * User: ZhuHaili
     * Date: 2024/1/30
     */
    function test() {
        $email_smtp = Fun::input('email_smtp'); // 选择的数据表
        $email_address = Fun::input('email_address'); // 选择的数据表
        $email_pwd = Fun::input('email_pwd'); // 选择的数据表
        $email_nick = Fun::input('email_nick'); // 选择的数据表
        $email_accept = Fun::input('email_accept'); // 选择的数据表
        if(!$email_smtp || !$email_address || !$email_pwd || !$email_nick || !$email_accept){
            Fun::json('配置信息全都必填', true);
        }
        $mail = new C_EmailServe();
        $result = $mail->emailtest($email_smtp, $email_address, $email_pwd, $email_nick, $email_accept);
        if($result){
            Fun::json('Y', true);
        }else{
            Fun::json('请检查配置信息', true);
        }
    }

}